/**
 * 
 */
package travibot.utility;

import org.apache.log4j.Logger;

/**
 * Class for generating delay between requests to simulate human like behaviour.
 * The time between requests is based on the minimal time settings and random
 * part.
 * 
 * @author Petr Macek
 * 
 */
public class RequestDelayGenarator {

    
    private static Logger log = Logger.getLogger(RequestDelayGenarator.class);
    
    
    private long minimalDelay = 10000;
    
    
    public long getMiliseconds(){
        long ret = (long)(Math.random() * 10000) + minimalDelay;
        log.info("Generating new delay: " + ret);
        return ret;
    }


    
    public void setMinimalDelay(long minimalDelay) {
    
        this.minimalDelay = minimalDelay;
    }
    
    
    
}
